package com.design.pattern.behavioral.strategy;

import org.apache.commons.lang3.StringUtils;

/**
 * description
 *
 * @author RenQiQiang 2019/03/15 9:22
 */
public class Test {
    public static void main(String[] args) {
  /*      PromotionActivity promotionActivity618 = new PromotionActivity(new LiJianPromotionStrategy());
        PromotionActivity promotionActivity1111 = new PromotionActivity(new FanXianPromotionStrategy());

        promotionActivity618.executePromotionStrategy();
        promotionActivity1111.executePromotionStrategy();
*/
/*    PromotionActivity promotionActivity = null;

    String promotionKey = "LIJIAN";

    if (StringUtils.equals(promotionKey, "LIJIAN")){
        promotionActivity = new PromotionActivity(new LiJianPromotionStrategy());
    }else if(StringUtils.equals(promotionKey, "FANXIAN")){
        promotionActivity = new PromotionActivity(new FanXianPromotionStrategy());
    }

    }*/
        String promotionKey = "LIJIAN";
        PromotionActivity promotionActivity = new PromotionActivity(
                PromotionStrategyFactory.getPromotionStrategyFactory(promotionKey)
        );
        promotionActivity.executePromotionStrategy();
    }
}

